// pages/index/index.js
const db = wx.cloud.database()
Page({
    data: {
        banners:[],
        Navigation:[],
        poster:[],
        product:[]
    },
    onLoad: function (options) {
        let that = this
        // 轮播图数据
        db.collection('swiper').get({
            success:function(res){
                that.setData({
                    banners:res.data
                })
            }
        }),
        // 导航栏数据
        db.collection('Navigation').get({
            success:function(res){
                that.setData({
                    Navigation:res.data
                })
            }
        })
        // 海报数据
        db.collection('poster').get({
            success:function(res){
                that.setData({
                    poster:res.data
                })
            }
        })
        //单品
        db.collection('product').get({
            success:function(res){
                console.log(res);
                that.setData({
                    product:res.data
                })
            }
        })
    },
})